/**
 * DSM - Distributed Search Manager
 * Developed by Milspec Research International Pty Ltd
 * $Author: skahl $
 * $Revision: 1.4 $
 * $Date: 2006/09/29 03:37:27 $
 * (c)Copyright 2004
 * education.au limited 
 * DEST
 * All rights reserved.
 * Redistribution and use in source and binary forms, with or without 
 * modification, are permitted provided that the following conditions are met:
 * Redistributions of source code must retain the above copyright notice, this 
 * list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright notice, 
 * this list of conditions and the following disclaimer in the documentation 
 * and/or other materials provided with the distribution.
 * Neither the names education.au limited, DEST nor the names of its 
 * contributors may be used to endorse or promote products derived from this 
 * software without specific prior written permission.
 * To the extent permitted by law, the copyright owners of this software and 
 * its contributors:
 * (i) exclude all warranties in relation to the software; and
 * (ii) exclude liability for all losses, costs, expenses and damages arising 
 * in any way from the use of the software whether arising from or in 
 * relation to breach of contract, negligence or any other tort, in equity
 * or otherwise. If the software is in breach of a warranty which is 
 * implied by law, the copyright owners and contributors liability is
 * limited to the replacement of the software.
 * 
 * @author	gsingh
 */

package au.edu.educationau.opensource.dsm.obj;

import java.util.ArrayList;
import java.util.List;

/**
 * Generic object to hold result item category data Most results from sources
 * are categorised in some way and this object can be used to hold this category
 * information
 */

public class ResultCategory extends java.lang.Object implements java.io.Serializable {

	private String code = "";
	/** XML Entity = code */
	private String name = "";
	/** XML Entity = name */
	private String alias = "";
	/** XML Entity = alias */
	private List paths = new ArrayList();

	/**
	 * Default constructor
	 */
	public ResultCategory() {
	}

	/**
	 * Loaded constructor for ResultCategory.
	 * 
	 * @param code
	 *            The unique id for this category
	 * @param name
	 *            The display name for this category
	 * @param path
	 *            The URL/URI for this category. URL preferred.
	 */
	public ResultCategory(String code, String name, String path) {
		this.code = code;
		this.name = name;
		this.paths.set(0, path);
	}

	/**
	 * Set the unique code for this category
	 * 
	 * @param code
	 */
	public void setCode(String code) {
		this.code = code;
	}

	/**
	 * Get the unique code for this category
	 */
	public String getCode() {
		return this.code;
	}

	/**
	 * Get the unique code for this category
	 * 
	 * @param name
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * Get the display name for this category
	 */
	public String getName() {
		return this.name;
	}

	/**
	 * Set the first URL or URI of the category
	 * 
	 * @param path
	 * @deprecated
	 */
	public void setPath(String path) {
		this.paths.set(0, path);
	}

	/**
	 * Get the first URL or URI of the category
	 * 
	 * @deprecated
	 */
	public String getPath() {
		return this.paths.get(0).toString();
	}

	/**
	 * Add path to list of paths
	 * 
	 * @param path
	 */
	public void addPath(String path) {
		this.paths.add(path);
	}

	/**
	 * Get the first URL or URI of the category
	 */
	public List getPaths() {
		return this.paths;
	}

	/**
	 * Set the alias of the category
	 */
	public void setAlias(String alias) {
		this.alias = alias;
	}

	/**
	 * Get the alias of the category
	 */
	public String getAlias() {
		return this.alias;
	}

} // class ResultCategory

// --EOF

